package com.guigu.service.impl;


import com.guigu.entity.MemberBean;
import com.guigu.entity.OrderBean;
import com.guigu.mapper.OrderMapper;
import com.guigu.service.OrderService;
import com.guigu.vo.PackageVO;
import com.guigu.vo.SubscribeListVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;

import java.util.List;

@Service
@Transactional
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;


    @Override
    public List<SubscribeListVO> selectOrder() {
        return this.orderMapper.selectOrder();
    }

    @Override
    public List<PackageVO> selectPackage() {
        return this.orderMapper.selectPackage();
    }

    @Override
    public MemberBean gjxmsfzcxhyxx(String name, String idCard) {
        return this.orderMapper.gjxmsfzcxhyxx(name, idCard);
    }

    @Override
    public void addOrder(OrderBean orderBean) {
        if (ObjectUtils.isEmpty(orderBean)) {
            throw new IllegalArgumentException("");
        }

        this.orderMapper.tjyy(orderBean);
    }

    @Override
    public void updateorderStatus(OrderBean orderBean) {

        this.orderMapper.updateorderStatus(orderBean);
    }
}
